package com.bto.solar.work.controller;

import com.bto.solar.work.common.R;
import com.bto.solar.work.dto.BtoStoResp;
import com.bto.solar.work.service.BtoStoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/bto/sto")
public class BtoStoController {

    @Autowired
    private BtoStoService btoStoService;

    @GetMapping("/{orderId}")
    public R<BtoStoResp> getBtoStoByBtoStoResp(@PathVariable("orderId") String orderId) {
        return R.ok(btoStoService.getBtoStoRespByOrderId(orderId));
    }
}
